package com.travel.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.travel.entity.po.UserComment;
import com.travel.mapper.UserCommentMapper;
import com.travel.service.UserCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Author:Jasenon_ce
 * Date: 2025.04.19/下午4:36
 */
@Service
public class UserCommentServiceImpl implements UserCommentService {

    @Autowired
    private UserCommentMapper userCommentMapper;

    @Override
    public void insert(UserComment userComment) {
        userCommentMapper.insert(userComment);
    }

    @Override
    public boolean delete(Long id) {
        QueryWrapper<UserComment> wrapper = new QueryWrapper<>();
        wrapper.eq("id", id);
        return userCommentMapper.delete(wrapper) > 0;
    }

//    @Override
//    public List<UserComment> getArticleComment(Long articleId) {
//        QueryWrapper<UserComment> wrapper = new QueryWrapper<>();
//        wrapper.eq("article_id", articleId);
//        return userCommentMapper.selectList(wrapper);
//    }

}
